package com.flycat.common.enumeration;

import java.util.Arrays;

/**
 * Created by linkun on 2017/9/3.
 */
public enum PayWayEnum {

    WEIXIN((byte)1,"微信"),
    ALIPAY((byte)2, "支付宝"),
    COUPON((byte)3, "支付宝"),
    ;

    private byte code;

    private String msg;

    PayWayEnum(byte code, String msg) {
        this.code = code;
        this.msg = msg;
    }
    public static PayWayEnum getEnum(byte type) {
        return Arrays.stream(PayWayEnum.values()).filter(item-> item.code==type).findFirst().get();
    }
    public byte getCode() {
        return code;
    }

    public void setCode(byte code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
